<?php
declare (strict_types = 1);

namespace app\api\model\v1;

use think\Env;
use think\Model;

/**
 * @mixin \think\Model
 * //志愿服务
 */
class Voluntary extends AppModel
{
    //

    const IS_TYPE_ONE = 1;
    const IS_TYPE_TWO = 2;

    public static $is_type = array(
        self::IS_TYPE_ONE => '自定义',
        self::IS_TYPE_TWO=> '文档'
    );


    const IS_STATUS_ONE = 1;
    const IS_STATUS_TWO = 2;
    const IS_STATUS_THREE = 3;

    public static $is_status = array(
        self::IS_STATUS_ONE => '待审核',
        self::IS_STATUS_TWO=> '已审核',
        self::IS_STATUS_TWO=> '不合格'
    );


    public function admin(){
        return $this->belongsTo(Admins::class,'admin_id')->field('id,username');
    }


    public function unit(){
        return $this->belongsTo(GatherCompany::class,'unit_id')->field('id,gather_company_title as title');
    }
}
